#include "CuadrangularObstacleSketcher.h"

#include <iostream>

CuadrangularObstacleSketcher::CuadrangularObstacleSketcher( CuadrangularObstacle* obstacle )
{
	this->obstacle = obstacle;
}
CuadrangularObstacleSketcher::~CuadrangularObstacleSketcher(void)
{
}

void CuadrangularObstacleSketcher::draw()
{
	Position*  startPoint = this->obstacle->getPosition();
	Color * obstacleLineColor = this->obstacle->getLineColor();
	Color * obstacleBackgroundColor = this->obstacle->getElementColor();
	Texture * obstacleTexture = this->obstacle->getTexture();
	int dist = this->obstacle->getMaxXPos();
	int altura = this->obstacle->getAltura();

	if(obstacleTexture != NULL) {
		SketcherHelper::getInstance()->drawSquare(startPoint,dist,altura,0,obstacleTexture,obstacleLineColor);
	}else {
		SketcherHelper::getInstance()->drawSquare(startPoint,dist,altura,0,obstacleBackgroundColor,obstacleLineColor);
	}
}